FROM golang:alpine3.7 AS build-server
COPY . /usr/local/go/src/thais 

WORKDIR /usr/local/go/src/thais
RUN go get \
    && go build  # -ldflags "-s -w"

FROM alpine:3.7
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
COPY --from=build-server /usr/local/go/src/thais/thais . 
COPY --from=build-server /usr/local/go/src/thais/.env .  
COPY --from=build-server /usr/local/go/src/thais/key.pem . 
COPY --from=build-server /usr/local/go/src/thais/cert.pem . 

EXPOSE 8080
EXPOSE 9090
EXPOSE 5000

CMD ./thais
